package com.batchaps.classes;

import javax.microedition.lcdui.Graphics;

import com.batchaps.global.GameEngine;

public class ImpedimentType2 extends Impediment{

	private int t;
	
	public ImpedimentType2(float posX , float posY , float sX , float sY , int w , int h){
		sprite2D = new Sprite2D(GameEngine.IMPEDIMENT_TYPE2_STR,
								GameEngine.IMPEDIMENT_TYPE2_N,
								GameEngine.IMPEDIMENT_TYPE2_STRTYPE, 
								w, h, sX, sY, posX, posY);
		isDraw = true;
		t = 0;
	}
	
	public int getType() {
		// TODO Auto-generated method stub
		return 2;//Type number wall
	}

	public void Update() {
		// TODO Auto-generated method stub
		if(isDraw){
			t++;
			if(t >= 50){
				t = 0;
				sprite2D.Update();
			}
			if(sprite2D.CheckISprite()){
				isDraw = false;
				//do something here
			}
		}
	}

	public void Draw(Graphics g) {
		// TODO Auto-generated method stub
		if(isDraw){
			sprite2D.Draw(g);
		}
	}

}
